<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
 <%@ include file="/common/query.jsp"%>
<%@ include file="/common/det.jsp"%>
<script>
    var categoryId = getQueryStringByDecode("productCategoryId");
        $(function(){
            init();
        });
        function init(){
            var setting = {};
            var url ="";
            var p_insert = false;
            var p_del = false;

            var columns = [
                {field:'id',title:'id',hidden:true},
                {field:'name',title:'商品名称',require:true},
                {field:'mainPicUrl',title:'主图', type:"img",update:false,insert:false},
                {field:'picUrls',title:'多图',type:"imgs",update:false,insert:false},
                {field:'productCategoryId',title:'productCategoryId',hidden:true,defaultValue:categoryId},
                {
                    field : 'caozuo',
                    title : '操作',
                    formatter : function(value, row, index) {
                        var html='';
                        html+='<a class="pure-button pure-button-primary"  href="javascript:go()">管理商品</a>';
                        return html;
                    }
                }
            ];
            url='/product/manager?search_EQ_productCategoryId='+categoryId;
            //setting.singleSelec	t = true;
            createQuery('body',columns,{pager:false,edit:true,editBtn:false,searchBar:{hidden:true},xuhao:false,add:true,del:true,heji:false,singleSelect:true},url);

        }

        function go() {
            var row = getGridSelected();
            window.top.tabAdd("'"+row.name+"管理'","${base}/product/detail?id="+row.id);
        }
</script>
</head>
<body>
	  <div id="body"></div>
</body>
</html>